<?php
function smarty_modifier_v($sUrl)
{
    static $__UI_VERSION;
    $sSite = 'http://'.__SVR_UISTATIC;
    if (!is_array($__UI_VERSION)) {
        $__ROOT_LIB = defined('__ROOT_LIB_LIB') ? __ROOT_LIB_LIB : __ROOT_LIB;
        $sConfigFile = $__ROOT_LIB.'/config/ui_version.config.php';
        if (file_exists($sConfigFile) && $sConfig = trim(file_get_contents($sConfigFile))) {
            if ('<?php' == substr($sConfig, 0, 5) && '?>' == substr($sConfig, -2)) {
                $sConfig = substr($sConfig, 5, -2);
                eval($sConfig); // get $__UI_VERSION
            }
            else {
                return $sSite.$sUrl;
            }
        }
        else {
            return $sSite.$sUrl;
        }
    }
    if ($__UI_VERSION[$sUrl]) {
        return $sSite.$__UI_VERSION[$sUrl];
    }
    else {
        return $sSite.$sUrl;
    }
}
?>
